import 'package:flutter/material.dart';

class GridViewPage extends StatefulWidget {
  @override
  _GridViewPageState createState() => _GridViewPageState();
}

class _GridViewPageState extends State<GridViewPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: GridView.extent(
        mainAxisSpacing: 50,
        crossAxisSpacing: 50,
        maxCrossAxisExtent: 100.0,
        childAspectRatio: 2.0,
        children: List.generate(
        20,
        (index) {
          return Container(color:Color.fromRGBO(index * 178 % 255, index * 178 % 255, index * 178 % 255, 1),child: Text((index + 1).toString()),);
        },
      ),
      ),
    );
  }
}
